package com.cl.master.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author xc
 * @Date 2023/5/18 17:36
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    // public enum Gender {
    //     Male, Female, Other
    // }
    public enum Gender {
        Male("男"), Female("女"), Other("其他");

        private final String name;

        Gender(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

        public static Gender fromName(String name) {
            for (Gender gender : values()) {
                if (gender.name.equals(name)) {
                    return gender;
                }
            }
            throw new IllegalArgumentException("Invalid Gender name: " + name);
        }
    }

    private int id;
    private String username;
    private String realName;
    private String address;
    private String phone;
    private String emergencyPhone;
    private String emergencyContact;
    // private Gender gender;
}
